
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>数组 · JavaScript学习</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Veng">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="Symbol.html" />
    
    
    <link rel="prev" href="对象.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="基础.html">
            
                <a href="基础.html">
            
                    
                    基础
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="变量.html">
            
                <a href="变量.html">
            
                    
                    数据类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="let和const命令.html">
            
                <a href="let和const命令.html">
            
                    
                    let和const命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="数值.html">
            
                <a href="数值.html">
            
                    
                    数值
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="字符串.html">
            
                <a href="字符串.html">
            
                    
                    字符串
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="对象.html">
            
                <a href="对象.html">
            
                    
                    对象
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2.6" data-path="数组.html">
            
                <a href="数组.html">
            
                    
                    数组
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="Symbol.html">
            
                <a href="Symbol.html">
            
                    
                    Symbol
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8" data-path="函数.html">
            
                <a href="函数.html">
            
                    
                    函数
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.8.1" data-path="函数的扩展.html">
            
                <a href="函数的扩展.html">
            
                    
                    函数的扩展
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.2" data-path="变量的解构赋值.html">
            
                <a href="变量的解构赋值.html">
            
                    
                    变量作用域与解构赋值
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.3" data-path="函数3.html">
            
                <a href="函数3.html">
            
                    
                    方法函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.4" data-path="高阶函数.html">
            
                <a href="高阶函数.html">
            
                    
                    高阶函数
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.8.4.1" data-path="map-reduce.html">
            
                <a href="map-reduce.html">
            
                    
                    map/reduce
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.4.2" data-path="filter.html">
            
                <a href="filter.html">
            
                    
                    filter
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.4.3" data-path="sort.html">
            
                <a href="sort.html">
            
                    
                    sort
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.4.4" data-path="array其他方法.html">
            
                <a href="array其他方法.html">
            
                    
                    array其他方法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.8.5" data-path="闭包.html">
            
                <a href="闭包.html">
            
                    
                    闭包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.6" data-path="箭头函数.html">
            
                <a href="箭头函数.html">
            
                    
                    箭头函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.7" data-path="../浏览器/Promise.html">
            
                <a href="../浏览器/Promise.html">
            
                    
                    Promise
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.8" data-path="generator.html">
            
                <a href="generator.html">
            
                    
                    generator
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.9" data-path="async.html">
            
                <a href="async.html">
            
                    
                    async
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.9" data-path="标准对象.html">
            
                <a href="标准对象.html">
            
                    
                    标准对象
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.9.1" data-path="SetMap.html">
            
                <a href="SetMap.html">
            
                    
                    Set,Map
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9.2" data-path="Date.html">
            
                <a href="Date.html">
            
                    
                    Date
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9.3" data-path="Math.html">
            
                <a href="Math.html">
            
                    
                    Math
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9.4" data-path="Proxy.html">
            
                <a href="Proxy.html">
            
                    
                    Proxy
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9.5" data-path="RepExp.html">
            
                <a href="RepExp.html">
            
                    
                    正则表达式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9.6" data-path="正则表达式.html">
            
                <a href="正则表达式.html">
            
                    
                    正则表达式别篇
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9.7" data-path="json.html">
            
                <a href="json.html">
            
                    
                    JSON
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.10" data-path="面向对象编程.html">
            
                <a href="面向对象编程.html">
            
                    
                    面向对象编程
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.10.1" data-path="对象的扩展.html">
            
                <a href="对象的扩展.html">
            
                    
                    对象的扩展
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.10.2" data-path="创建对象.html">
            
                <a href="创建对象.html">
            
                    
                    创建对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.10.3" data-path="原型继承.html">
            
                <a href="原型继承.html">
            
                    
                    原型继承
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.10.4" data-path="class继承.html">
            
                <a href="class继承.html">
            
                    
                    class继承
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.10.5" data-path="模块化Module.html">
            
                <a href="模块化Module.html">
            
                    
                    模块化Module
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.11" data-path="异常处理.html">
            
                <a href="异常处理.html">
            
                    
                    异常处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.12" data-path="编程风格.html">
            
                <a href="编程风格.html">
            
                    
                    编程风格
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../js扩展/js扩展.html">
            
                <a href="../js扩展/js扩展.html">
            
                    
                    js 扩展
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../js扩展/字符串.html">
            
                <a href="../js扩展/字符串.html">
            
                    
                    字符串
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../浏览器/浏览器.html">
            
                <a href="../浏览器/浏览器.html">
            
                    
                    浏览器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../浏览器/浏览器对象.html">
            
                <a href="../浏览器/浏览器对象.html">
            
                    
                    浏览器对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../浏览器/操作DOM.html">
            
                <a href="../浏览器/操作DOM.html">
            
                    
                    操作DOM
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.2.1" data-path="../浏览器/更新DOM.html">
            
                <a href="../浏览器/更新DOM.html">
            
                    
                    更新DOM
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2.2" data-path="../浏览器/插入DOM.html">
            
                <a href="../浏览器/插入DOM.html">
            
                    
                    插入DOM
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2.3" data-path="../浏览器/删除DOM.html">
            
                <a href="../浏览器/删除DOM.html">
            
                    
                    删除DOM
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../浏览器/DOM事件.html">
            
                <a href="../浏览器/DOM事件.html">
            
                    
                    DOM事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../浏览器/操作表单.html">
            
                <a href="../浏览器/操作表单.html">
            
                    
                    操作表单
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../浏览器/操作文件.html">
            
                <a href="../浏览器/操作文件.html">
            
                    
                    操作文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../浏览器/AJAX.html">
            
                <a href="../浏览器/AJAX.html">
            
                    
                    AJAX
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="../浏览器/Canvas.html">
            
                <a href="../浏览器/Canvas.html">
            
                    
                    Canvas
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../Jquery/jquery.html">
            
                <a href="../Jquery/jquery.html">
            
                    
                    Jquery
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../Jquery/选择器.html">
            
                <a href="../Jquery/选择器.html">
            
                    
                    选择器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1.1" data-path="../Jquery/层级选择器.html">
            
                <a href="../Jquery/层级选择器.html">
            
                    
                    层级选择器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.2" data-path="../Jquery/查找和过滤.html">
            
                <a href="../Jquery/查找和过滤.html">
            
                    
                    查找和过滤
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../Jquery/操作DOM.html">
            
                <a href="../Jquery/操作DOM.html">
            
                    
                    操作DOM
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.2.1" data-path="../Jquery/修改DOM结构.html">
            
                <a href="../Jquery/修改DOM结构.html">
            
                    
                    修改DOM结构
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../Jquery/事件.html">
            
                <a href="../Jquery/事件.html">
            
                    
                    事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../Jquery/动画.html">
            
                <a href="../Jquery/动画.html">
            
                    
                    动画
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../Jquery/AJAX.html">
            
                <a href="../Jquery/AJAX.html">
            
                    
                    AJAX
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="../Jquery/扩展.html">
            
                <a href="../Jquery/扩展.html">
            
                    
                    扩展
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../nodejs/nodejs.html">
            
                <a href="../nodejs/nodejs.html">
            
                    
                    Nodejs
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../nodejs/模块.html">
            
                <a href="../nodejs/模块.html">
            
                    
                    模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../nodejs/path.html">
            
                <a href="../nodejs/path.html">
            
                    
                    path
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../nodejs/文件操作.html">
            
                <a href="../nodejs/文件操作.html">
            
                    
                    文件操作 fs
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../nodejs/流Stream.html">
            
                <a href="../nodejs/流Stream.html">
            
                    
                    流Stream
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../nodejs/zlib压缩解压缩.html">
            
                <a href="../nodejs/zlib压缩解压缩.html">
            
                    
                    zlib压缩解压缩
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../nodejs/net网络.html">
            
                <a href="../nodejs/net网络.html">
            
                    
                    net网络
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../nodejs/http.html">
            
                <a href="../nodejs/http.html">
            
                    
                    http
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="../nodejs/express框架.html">
            
                <a href="../nodejs/express框架.html">
            
                    
                    express框架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9" data-path="../nodejs/process进程.html">
            
                <a href="../nodejs/process进程.html">
            
                    
                    process 进程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.10" data-path="../nodejs/child_process.html">
            
                <a href="../nodejs/child_process.html">
            
                    
                    child_process
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.11" data-path="../nodejs/os.html">
            
                <a href="../nodejs/os.html">
            
                    
                    os-操作系统
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../react/react.html">
            
                <a href="../react/react.html">
            
                    
                    React
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >数组</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x6570;&#x7EC4;">&#x6570;&#x7EC4;</h1>
<p>JavaScript&#x7684;<code>Array</code>&#x53EF;&#x4EE5;&#x5305;&#x542B;&#x4EFB;&#x610F;&#x6570;&#x636E;&#x7C7B;&#x578B;&#xFF0C;&#x5E76;&#x901A;&#x8FC7;&#x7D22;&#x5F15;&#x6765;&#x8BBF;&#x95EE;&#x6BCF;&#x4E2A;&#x5143;&#x7D20;&#x3002;</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">var</span> array = [<span class="hljs-number">0.1</span>,<span class="hljs-string">&apos;a&apos;</span>,<span class="hljs-literal">false</span>,<span class="hljs-literal">null</span>];
<span class="hljs-comment">// &#x901A;&#x8FC7;length&#x83B7;&#x53D6;&#x6570;&#x7EC4;&#x7684;&#x957F;&#x5EA6;</span>
<span class="hljs-keyword">var</span> length = array.length;
<span class="hljs-comment">/*
&#x4E4B;&#x524D;&#x5728;&#x5B57;&#x7B26;&#x4E32;&#x90A3;&#x91CC;&#x63D0;&#x8FC7;&#xFF0C;&#x7D22;&#x5F15;&#x5B57;&#x7B26;&#x4E32;&#x7684;&#x67D0;&#x4E2A;&#x5B57;&#x7B26;,
&#x4E0D;&#x540C;&#x7684;&#x662F;&#xFF0C;&#x5B83;&#x5BF9;&#x7D22;&#x5F15;&#x8D4B;&#x503C;,array&#x7684;&#x503C;&#x4F1A;&#x53D1;&#x751F;&#x53D8;&#x5316;
 */</span>
array[<span class="hljs-number">1</span>] = <span class="hljs-string">&quot;b&quot;</span>;
<span class="hljs-comment">/*
 &#x5BF9;&#x6570;&#x7EC4;&#x7684;&#x957F;&#x5EA6;&#x76F4;&#x63A5;&#x8D4B;&#x503C;,&#x6570;&#x7EC4;&#x7684;&#x957F;&#x5EA6;&#x4E5F;&#x4F1A;&#x76F8;&#x5E94;&#x53D8;&#x5316;
 &#x5982;&#x4E0B;&#x9762;&#x7684;,array&#x7684;&#x957F;&#x5EA6;&#x5DF2;&#x53D8;&#x4E3A; 6,
 &#x540E;&#x9762;&#x7684;&#x4EE5; undefined &#x586B;&#x5145;,
 &#x5982;&#x679C;&#x4FEE;&#x6539;&#x7684;length &#x6BD4;&#x539F;&#x6765;&#x7684;&#x66F4;&#x77ED;,
 &#x5219;&#x628A;&#x591A;&#x4F59;&#x7684;&#x5143;&#x7D20;&#x53BB;&#x6389;
 */</span>
array.length = <span class="hljs-number">6</span>;
<span class="hljs-comment">// &#x5982;&#x679C;&#x901A;&#x8FC7;&#x7D22;&#x5F15;&#x8D4B;&#x503C;&#x65F6;&#xFF0C;&#x7D22;&#x5F15;&#x8D85;&#x8FC7;&#x4E86;&#x8303;&#x56F4;&#xFF0C;&#x540C;&#x6837;&#x4F1A;&#x5F15;&#x8D77;Array&#x5927;&#x5C0F;&#x7684;&#x53D8;&#x5316;&#xFF1A;</span>
array[<span class="hljs-number">7</span>] = <span class="hljs-number">7</span>;
</code></pre>
<pre><code class="lang-shell">array =&gt; [0.1,&apos;b&apos;,false,null]  &#x8D4B;&#x503C;&#x540E;
</code></pre>
<p>&#x5927;&#x591A;&#x6570;&#x5176;&#x4ED6;&#x7F16;&#x7A0B;&#x8BED;&#x8A00;&#x4E0D;&#x5141;&#x8BB8;&#x76F4;&#x63A5;&#x6539;&#x53D8;&#x6570;&#x7EC4;&#x7684;&#x5927;&#x5C0F;&#xFF0C;&#x8D8A;&#x754C;&#x8BBF;&#x95EE;&#x7D22;&#x5F15;&#x4F1A;&#x62A5;&#x9519;&#x3002;&#x7136;&#x800C;&#xFF0C;JavaScript&#x7684;<code>Array</code>&#x5374;&#x4E0D;&#x4F1A;&#x6709;&#x4EFB;&#x4F55;&#x9519;&#x8BEF;&#x3002;&#x5728;&#x7F16;&#x5199;&#x4EE3;&#x7801;&#x65F6;&#xFF0C;&#x4E0D;&#x5EFA;&#x8BAE;&#x76F4;&#x63A5;&#x4FEE;&#x6539;<code>Array</code>&#x7684;&#x5927;&#x5C0F;&#xFF0C;&#x8BBF;&#x95EE;&#x7D22;&#x5F15;&#x65F6;&#x8981;&#x786E;&#x4FDD;&#x7D22;&#x5F15;&#x4E0D;&#x4F1A;&#x8D8A;&#x754C;&#x3002;</p>
<h2 id="&#x6570;&#x7EC4;&#x7684;&#x672C;&#x8D28;">&#x6570;&#x7EC4;&#x7684;&#x672C;&#x8D28;</h2>
<p>&#x672C;&#x8D28;&#x4E0A;&#xFF0C;&#x6570;&#x7EC4;&#x5C5E;&#x4E8E;&#x4E00;&#x79CD;&#x7279;&#x6B8A;&#x7684;&#x5BF9;&#x8C61;&#x3002;<code>typeof</code>&#x8FD0;&#x7B97;&#x7B26;&#x4F1A;&#x8FD4;&#x56DE;&#x6570;&#x7EC4;&#x7684;&#x7C7B;&#x578B;&#x662F;<code>object</code>&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-keyword">typeof</span> [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>] <span class="hljs-comment">// &quot;object&quot;</span>
</code></pre>
<p>&#x6570;&#x7EC4;&#x7684;&#x7279;&#x6B8A;&#x6027;&#x4F53;&#x73B0;&#x5728;&#xFF0C;&#x5B83;&#x7684;&#x952E;&#x540D;&#x662F;&#x6309;&#x6B21;&#x5E8F;&#x6392;&#x5217;&#x7684;&#x4E00;&#x7EC4;&#x6574;&#x6570;&#xFF08;0&#xFF0C;1&#xFF0C;2...&#xFF09;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-keyword">var</span> arr = [<span class="hljs-string">&apos;a&apos;</span>, <span class="hljs-string">&apos;b&apos;</span>, <span class="hljs-string">&apos;c&apos;</span>];

<span class="hljs-built_in">Object</span>.keys(arr)
<span class="hljs-comment">// [&quot;0&quot;, &quot;1&quot;, &quot;2&quot;]</span>
</code></pre>
<p>&#x4E0A;&#x9762;&#x4EE3;&#x7801;&#x4E2D;&#xFF0C;<code>Object.keys</code>&#x65B9;&#x6CD5;&#x8FD4;&#x56DE;&#x6570;&#x7EC4;&#x7684;&#x6240;&#x6709;&#x952E;&#x540D;&#x3002;&#x53EF;&#x4EE5;&#x770B;&#x5230;&#x6570;&#x7EC4;&#x7684;&#x952E;&#x540D;&#x5C31;&#x662F;&#x6574;&#x6570;0&#x3001;1&#x3001;2&#x3002;</p>
<p>&#x7531;&#x4E8E;&#x6570;&#x7EC4;&#x6210;&#x5458;&#x7684;&#x952E;&#x540D;&#x662F;&#x56FA;&#x5B9A;&#x7684;&#xFF08;&#x9ED8;&#x8BA4;&#x603B;&#x662F;0&#x3001;1&#x3001;2...&#xFF09;&#xFF0C;&#x56E0;&#x6B64;&#x6570;&#x7EC4;&#x4E0D;&#x7528;&#x4E3A;&#x6BCF;&#x4E2A;&#x5143;&#x7D20;&#x6307;&#x5B9A;&#x952E;&#x540D;&#xFF0C;&#x800C;&#x5BF9;&#x8C61;&#x7684;&#x6BCF;&#x4E2A;&#x6210;&#x5458;&#x90FD;&#x5FC5;&#x987B;&#x6307;&#x5B9A;&#x952E;&#x540D;&#x3002;JavaScript &#x8BED;&#x8A00;&#x89C4;&#x5B9A;&#xFF0C;&#x5BF9;&#x8C61;&#x7684;&#x952E;&#x540D;&#x4E00;&#x5F8B;&#x4E3A;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x6240;&#x4EE5;&#xFF0C;&#x6570;&#x7EC4;&#x7684;&#x952E;&#x540D;&#x5176;&#x5B9E;&#x4E5F;&#x662F;&#x5B57;&#x7B26;&#x4E32;&#x3002;&#x4E4B;&#x6240;&#x4EE5;&#x53EF;&#x4EE5;&#x7528;&#x6570;&#x503C;&#x8BFB;&#x53D6;&#xFF0C;&#x662F;&#x56E0;&#x4E3A;&#x975E;&#x5B57;&#x7B26;&#x4E32;&#x7684;&#x952E;&#x540D;&#x4F1A;&#x88AB;&#x8F6C;&#x4E3A;&#x5B57;&#x7B26;&#x4E32;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-keyword">var</span> arr = [<span class="hljs-string">&apos;a&apos;</span>, <span class="hljs-string">&apos;b&apos;</span>, <span class="hljs-string">&apos;c&apos;</span>];

arr[<span class="hljs-string">&apos;0&apos;</span>] <span class="hljs-comment">// &apos;a&apos;</span>
arr[<span class="hljs-number">0</span>] <span class="hljs-comment">// &apos;a&apos;</span>
</code></pre>
<p>&#x4E0A;&#x9762;&#x4EE3;&#x7801;&#x5206;&#x522B;&#x7528;&#x6570;&#x503C;&#x548C;&#x5B57;&#x7B26;&#x4E32;&#x4F5C;&#x4E3A;&#x952E;&#x540D;&#xFF0C;&#x7ED3;&#x679C;&#x90FD;&#x80FD;&#x8BFB;&#x53D6;&#x6570;&#x7EC4;&#x3002;&#x539F;&#x56E0;&#x662F;&#x6570;&#x503C;&#x952E;&#x540D;&#x88AB;&#x81EA;&#x52A8;&#x8F6C;&#x4E3A;&#x4E86;&#x5B57;&#x7B26;&#x4E32;&#x3002;</p>
<h2 id="length-&#x5C5E;&#x6027;">length &#x5C5E;&#x6027;</h2>
<p>&#x6570;&#x7EC4;&#x7684;<code>length</code>&#x5C5E;&#x6027;&#xFF0C;&#x8FD4;&#x56DE;&#x6570;&#x7EC4;&#x7684;&#x6210;&#x5458;&#x6570;&#x91CF;&#x3002;</p>
<pre><code class="lang-js">[<span class="hljs-string">&apos;a&apos;</span>, <span class="hljs-string">&apos;b&apos;</span>, <span class="hljs-string">&apos;c&apos;</span>].length <span class="hljs-comment">// 3</span>
</code></pre>
<p>JavaScript &#x4F7F;&#x7528;&#x4E00;&#x4E2A;32&#x4F4D;&#x6574;&#x6570;&#xFF0C;&#x4FDD;&#x5B58;&#x6570;&#x7EC4;&#x7684;&#x5143;&#x7D20;&#x4E2A;&#x6570;&#x3002;&#x8FD9;&#x610F;&#x5473;&#x7740;&#xFF0C;&#x6570;&#x7EC4;&#x6210;&#x5458;&#x6700;&#x591A;&#x53EA;&#x6709; 4294967295 &#x4E2A;&#xFF08;$$2^{32} - 1$$&#xFF09;&#x4E2A;&#xFF0C;&#x4E5F;&#x5C31;&#x662F;&#x8BF4;<code>length</code>&#x5C5E;&#x6027;&#x7684;&#x6700;&#x5927;&#x503C;&#x5C31;&#x662F; 4294967295&#x3002;</p>
<p>&#x53EA;&#x8981;&#x662F;&#x6570;&#x7EC4;&#xFF0C;&#x5C31;&#x4E00;&#x5B9A;&#x6709;<code>length</code>&#x5C5E;&#x6027;&#x3002;&#x8BE5;&#x5C5E;&#x6027;&#x662F;&#x4E00;&#x4E2A;&#x52A8;&#x6001;&#x7684;&#x503C;&#xFF0C;&#x7B49;&#x4E8E;&#x952E;&#x540D;&#x4E2D;&#x7684;&#x6700;&#x5927;&#x6574;&#x6570;&#x52A0;&#x4E0A;<code>1</code>&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-keyword">var</span> arr = [<span class="hljs-string">&apos;a&apos;</span>, <span class="hljs-string">&apos;b&apos;</span>];
arr.length <span class="hljs-comment">// 2</span>

arr[<span class="hljs-number">2</span>] = <span class="hljs-string">&apos;c&apos;</span>;
arr.length <span class="hljs-comment">// 3</span>
</code></pre>
<p><code>length</code>&#x5C5E;&#x6027;&#x662F;&#x53EF;&#x5199;&#x7684;&#x3002;&#x5982;&#x679C;&#x4EBA;&#x4E3A;&#x8BBE;&#x7F6E;&#x4E00;&#x4E2A;&#x5C0F;&#x4E8E;&#x5F53;&#x524D;&#x6210;&#x5458;&#x4E2A;&#x6570;&#x7684;&#x503C;&#xFF0C;&#x8BE5;&#x6570;&#x7EC4;&#x7684;&#x6210;&#x5458;&#x4F1A;&#x81EA;&#x52A8;&#x51CF;&#x5C11;&#x5230;<code>length</code>&#x8BBE;&#x7F6E;&#x7684;&#x503C;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-keyword">var</span> arr = [ <span class="hljs-string">&apos;a&apos;</span>, <span class="hljs-string">&apos;b&apos;</span>, <span class="hljs-string">&apos;c&apos;</span> ];
arr.length <span class="hljs-comment">// 3</span>

arr.length = <span class="hljs-number">2</span>;
arr <span class="hljs-comment">// [&quot;a&quot;, &quot;b&quot;]</span>
</code></pre>
<p>&#x6E05;&#x7A7A;&#x6570;&#x7EC4;&#x7684;&#x4E00;&#x4E2A;&#x6709;&#x6548;&#x65B9;&#x6CD5;&#xFF0C;&#x5C31;&#x662F;&#x5C06;<code>length</code>&#x5C5E;&#x6027;&#x8BBE;&#x4E3A;0&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-keyword">var</span> arr = [ <span class="hljs-string">&apos;a&apos;</span>, <span class="hljs-string">&apos;b&apos;</span>, <span class="hljs-string">&apos;c&apos;</span> ];

arr.length = <span class="hljs-number">0</span>;
arr <span class="hljs-comment">// []</span>
</code></pre>
<h3 id="&#x6570;&#x7EC4;&#x7684;for&#x5FAA;&#x73AF;&#x904D;&#x5386;">&#x6570;&#x7EC4;&#x7684;for&#x5FAA;&#x73AF;&#x904D;&#x5386;</h3>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> array = [<span class="hljs-number">1</span>,<span class="hljs-number">23</span>,<span class="hljs-number">4</span>];
<span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> index <span class="hljs-keyword">in</span> array){
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">`index: <span class="hljs-subst">${index}</span>`</span>);
}

<span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> number <span class="hljs-keyword">of</span> array) {
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">`value: <span class="hljs-subst">${number}</span>`</span>);
}
<span class="hljs-comment">/**
index: 0
index: 1
index: 2
value: 1
value: 23
value: 4
*/</span>
</code></pre>
<h2 id="&#x6570;&#x7EC4;&#x7684;&#x7A7A;&#x4F4D;">&#x6570;&#x7EC4;&#x7684;&#x7A7A;&#x4F4D;</h2>
<p>&#x5F53;&#x6570;&#x7EC4;&#x7684;&#x67D0;&#x4E2A;&#x4F4D;&#x7F6E;&#x662F;&#x7A7A;&#x5143;&#x7D20;&#xFF0C;&#x5373;&#x4E24;&#x4E2A;&#x9017;&#x53F7;&#x4E4B;&#x95F4;&#x6CA1;&#x6709;&#x4EFB;&#x4F55;&#x503C;&#xFF0C;&#x6211;&#x4EEC;&#x79F0;&#x8BE5;&#x6570;&#x7EC4;&#x5B58;&#x5728;&#x7A7A;&#x4F4D;&#xFF08;hole&#xFF09;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-keyword">var</span> a = [<span class="hljs-number">1</span>, , <span class="hljs-number">1</span>];
a.length <span class="hljs-comment">// 3</span>
</code></pre>
<p>&#x4E0A;&#x9762;&#x4EE3;&#x7801;&#x8868;&#x660E;&#xFF0C;&#x6570;&#x7EC4;&#x7684;&#x7A7A;&#x4F4D;&#x4E0D;&#x5F71;&#x54CD;<code>length</code>&#x5C5E;&#x6027;&#x3002;&#x7A7A;&#x4F4D;&#x4E3A; <code>undefined</code>&#x3002;</p>
<p>&#x4F7F;&#x7528;<code>delete</code>&#x547D;&#x4EE4;&#x5220;&#x9664;&#x4E00;&#x4E2A;&#x6570;&#x7EC4;&#x6210;&#x5458;&#xFF0C;&#x4F1A;&#x5F62;&#x6210;&#x7A7A;&#x4F4D;&#xFF0C;&#x5E76;&#x4E14;&#x4E0D;&#x4F1A;&#x5F71;&#x54CD;<code>length</code>&#x5C5E;&#x6027;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-keyword">var</span> a = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>];
<span class="hljs-keyword">delete</span> a[<span class="hljs-number">1</span>];

a[<span class="hljs-number">1</span>] <span class="hljs-comment">// undefined</span>
a.length <span class="hljs-comment">// 3</span>
</code></pre>
<p><font color="red">&#x6CE8;&#x610F;</font>&#xFF1A;&#x4E0A;&#x9762;&#x4EE3;&#x7801;&#x7528;<code>delete</code>&#x547D;&#x4EE4;&#x5220;&#x9664;&#x4E86;&#x6570;&#x7EC4;&#x7684;&#x7B2C;&#x4E8C;&#x4E2A;&#x5143;&#x7D20;&#xFF0C;&#x8FD9;&#x4E2A;&#x4F4D;&#x7F6E;&#x5C31;&#x5F62;&#x6210;&#x4E86;&#x7A7A;&#x4F4D;&#xFF0C;&#x4F46;&#x662F;&#x5BF9;<code>length</code>&#x5C5E;&#x6027;&#x6CA1;&#x6709;&#x5F71;&#x54CD;&#x3002;&#x4E5F;&#x5C31;&#x662F;&#x8BF4;&#xFF0C;<code>length</code>&#x5C5E;&#x6027;&#x4E0D;&#x8FC7;&#x6EE4;&#x7A7A;&#x4F4D;&#x3002;&#x6240;&#x4EE5;&#xFF0C;&#x4F7F;&#x7528;<code>length</code>&#x5C5E;&#x6027;&#x8FDB;&#x884C;&#x6570;&#x7EC4;&#x904D;&#x5386;&#xFF0C;&#x4E00;&#x5B9A;&#x8981;&#x975E;&#x5E38;&#x5C0F;&#x5FC3;&#x3002;</p>
<p>&#x6570;&#x7EC4;&#x7684;&#x67D0;&#x4E2A;&#x4F4D;&#x7F6E;&#x662F;&#x7A7A;&#x4F4D;&#xFF0C;&#x4E0E;&#x67D0;&#x4E2A;&#x4F4D;&#x7F6E;&#x662F;<code>undefined</code>&#xFF0C;&#x662F;&#x4E0D;&#x4E00;&#x6837;&#x7684;&#x3002;&#x5982;&#x679C;&#x662F;&#x7A7A;&#x4F4D;&#xFF0C;&#x4F7F;&#x7528;&#x6570;&#x7EC4;&#x7684;<code>forEach</code>&#x65B9;&#x6CD5;&#x3001;<code>for...in</code>&#x7ED3;&#x6784;&#x3001;&#x4EE5;&#x53CA;<code>Object.keys</code>&#x65B9;&#x6CD5;&#x8FDB;&#x884C;&#x904D;&#x5386;&#xFF0C;&#x7A7A;&#x4F4D;&#x90FD;&#x4F1A;&#x88AB;&#x8DF3;&#x8FC7;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-keyword">var</span> a = [, , ,];

a.forEach(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">x, i</span>) </span>{
  <span class="hljs-built_in">console</span>.log(i + <span class="hljs-string">&apos;. &apos;</span> + x);
})
<span class="hljs-comment">// &#x4E0D;&#x4EA7;&#x751F;&#x4EFB;&#x4F55;&#x8F93;&#x51FA;</span>

<span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i <span class="hljs-keyword">in</span> a) {
  <span class="hljs-built_in">console</span>.log(i);
}
<span class="hljs-comment">// &#x4E0D;&#x4EA7;&#x751F;&#x4EFB;&#x4F55;&#x8F93;&#x51FA;</span>

<span class="hljs-built_in">Object</span>.keys(a)
<span class="hljs-comment">// []</span>
</code></pre>
<p>&#x5982;&#x679C;&#x67D0;&#x4E2A;&#x4F4D;&#x7F6E;&#x662F;<code>undefined</code>&#xFF0C;&#x904D;&#x5386;&#x7684;&#x65F6;&#x5019;&#x5C31;&#x4E0D;&#x4F1A;&#x88AB;&#x8DF3;&#x8FC7;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-keyword">var</span> a = [<span class="hljs-literal">undefined</span>, <span class="hljs-literal">undefined</span>, <span class="hljs-literal">undefined</span>];

a.forEach(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">x, i</span>) </span>{
  <span class="hljs-built_in">console</span>.log(i + <span class="hljs-string">&apos;. &apos;</span> + x);
});
<span class="hljs-comment">// 0. undefined</span>
<span class="hljs-comment">// 1. undefined</span>
<span class="hljs-comment">// 2. undefined</span>
</code></pre>
<h2 id="&#x7C7B;&#x4F3C;&#x6570;&#x7EC4;&#x7684;&#x5BF9;&#x8C61;">&#x7C7B;&#x4F3C;&#x6570;&#x7EC4;&#x7684;&#x5BF9;&#x8C61;</h2>
<p>&#x5982;&#x679C;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#x7684;&#x6240;&#x6709;&#x952E;&#x540D;&#x90FD;&#x662F;&#x6B63;&#x6574;&#x6570;&#x6216;&#x96F6;&#xFF0C;&#x5E76;&#x4E14;&#x6709;<code>length</code>&#x5C5E;&#x6027;&#xFF0C;&#x90A3;&#x4E48;&#x8FD9;&#x4E2A;&#x5BF9;&#x8C61;&#x5C31;&#x5F88;&#x50CF;&#x6570;&#x7EC4;&#xFF0C;&#x8BED;&#x6CD5;&#x4E0A;&#x79F0;&#x4E3A;&#x201C;&#x7C7B;&#x4F3C;&#x6570;&#x7EC4;&#x7684;&#x5BF9;&#x8C61;&#x201D;&#xFF08;array-like object&#xFF09;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-keyword">var</span> obj = {
  <span class="hljs-number">0</span>: <span class="hljs-string">&apos;a&apos;</span>,
  <span class="hljs-number">1</span>: <span class="hljs-string">&apos;b&apos;</span>,
  <span class="hljs-number">2</span>: <span class="hljs-string">&apos;c&apos;</span>,
  length: <span class="hljs-number">3</span>
};

obj[<span class="hljs-number">0</span>] <span class="hljs-comment">// &apos;a&apos;</span>
obj[<span class="hljs-number">1</span>] <span class="hljs-comment">// &apos;b&apos;</span>
obj.length <span class="hljs-comment">// 3</span>
obj.push(<span class="hljs-string">&apos;d&apos;</span>) <span class="hljs-comment">// TypeError: obj.push is not a function</span>
</code></pre>
<p>&#x5178;&#x578B;&#x7684;&#x201C;&#x7C7B;&#x4F3C;&#x6570;&#x7EC4;&#x7684;&#x5BF9;&#x8C61;&#x201D;&#x662F;&#x51FD;&#x6570;&#x7684;<code>arguments</code>&#x5BF9;&#x8C61;&#xFF0C;&#x4EE5;&#x53CA;&#x5927;&#x591A;&#x6570; DOM &#x5143;&#x7D20;&#x96C6;&#xFF0C;&#x8FD8;&#x6709;&#x5B57;&#x7B26;&#x4E32;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-comment">// arguments&#x5BF9;&#x8C61;</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">args</span>(<span class="hljs-params"></span>) </span>{ <span class="hljs-keyword">return</span> <span class="hljs-built_in">arguments</span> }
<span class="hljs-keyword">var</span> arrayLike = args(<span class="hljs-string">&apos;a&apos;</span>, <span class="hljs-string">&apos;b&apos;</span>);

arrayLike[<span class="hljs-number">0</span>] <span class="hljs-comment">// &apos;a&apos;</span>
arrayLike.length <span class="hljs-comment">// 2</span>
arrayLike <span class="hljs-keyword">instanceof</span> <span class="hljs-built_in">Array</span> <span class="hljs-comment">// false</span>

<span class="hljs-comment">// DOM&#x5143;&#x7D20;&#x96C6;</span>
<span class="hljs-keyword">var</span> elts = <span class="hljs-built_in">document</span>.getElementsByTagName(<span class="hljs-string">&apos;h3&apos;</span>);
elts.length <span class="hljs-comment">// 3</span>
elts <span class="hljs-keyword">instanceof</span> <span class="hljs-built_in">Array</span> <span class="hljs-comment">// false</span>

<span class="hljs-comment">// &#x5B57;&#x7B26;&#x4E32;</span>
<span class="hljs-string">&apos;abc&apos;</span>[<span class="hljs-number">1</span>] <span class="hljs-comment">// &apos;b&apos;</span>
<span class="hljs-string">&apos;abc&apos;</span>.length <span class="hljs-comment">// 3</span>
<span class="hljs-string">&apos;abc&apos;</span> <span class="hljs-keyword">instanceof</span> <span class="hljs-built_in">Array</span> <span class="hljs-comment">// false</span>
</code></pre>
<p>&#x6570;&#x7EC4;&#x7684;<code>slice</code>&#x65B9;&#x6CD5;&#x53EF;&#x4EE5;&#x5C06;&#x201C;&#x7C7B;&#x4F3C;&#x6570;&#x7EC4;&#x7684;&#x5BF9;&#x8C61;&#x201D;&#x53D8;&#x6210;&#x771F;&#x6B63;&#x7684;&#x6570;&#x7EC4;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-keyword">var</span> arr = <span class="hljs-built_in">Array</span>.prototype.slice.call(arrayLike);
</code></pre>
<h2 id="array-&#x7684;&#x5E38;&#x7528;&#x65B9;&#x6CD5;"><code>Array</code> &#x7684;&#x5E38;&#x7528;&#x65B9;&#x6CD5;</h2>
<ul>
<li>indexOf</li>
</ul>
<p>&#x4E0E;String&#x7C7B;&#x4F3C;&#xFF0C;<code>Array</code>&#x4E5F;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;<code>indexOf()</code>&#x6765;&#x641C;&#x7D22;&#x4E00;&#x4E2A;&#x6307;&#x5B9A;&#x7684;&#x5143;&#x7D20;&#x7684;&#x4F4D;&#x7F6E;</p>
<ul>
<li><p>slice</p>
<p><code>slice()</code>&#x5C31;&#x662F;&#x5BF9;&#x5E94;String&#x7684;<code>substring()</code>&#x7248;&#x672C;&#xFF0C;&#x5B83;&#x622A;&#x53D6;<code>Array</code>&#x7684;&#x90E8;&#x5206;&#x5143;&#x7D20;&#xFF0C;&#x7136;&#x540E;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x65B0;&#x7684;<code>Array</code>,
&#x5982;&#x679C;&#x4E0D;&#x7ED9;<code>slice()</code>&#x4F20;&#x9012;&#x4EFB;&#x4F55;&#x53C2;&#x6570;&#xFF0C;&#x5B83;&#x5C31;&#x4F1A;&#x4ECE;&#x5934;&#x5230;&#x5C3E;&#x622A;&#x53D6;&#x6240;&#x6709;&#x5143;&#x7D20;&#x3002;&#x5229;&#x7528;&#x8FD9;&#x4E00;&#x70B9;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x5F88;&#x5BB9;&#x6613;&#x5730;&#x590D;&#x5236;&#x4E00;&#x4E2A;<code>Array</code></p>
<pre><code class="lang-javascript"><span class="hljs-keyword">var</span> arr = [<span class="hljs-string">&apos;A&apos;</span>, <span class="hljs-string">&apos;B&apos;</span>, <span class="hljs-string">&apos;C&apos;</span>, <span class="hljs-string">&apos;D&apos;</span>, <span class="hljs-string">&apos;E&apos;</span>, <span class="hljs-string">&apos;F&apos;</span>, <span class="hljs-string">&apos;G&apos;</span>];
arr.slice(<span class="hljs-number">0</span>, <span class="hljs-number">3</span>); <span class="hljs-comment">// &#x4ECE;&#x7D22;&#x5F15;0&#x5F00;&#x59CB;&#xFF0C;&#x5230;&#x7D22;&#x5F15;3&#x7ED3;&#x675F;&#xFF0C;&#x4F46;&#x4E0D;&#x5305;&#x62EC;&#x7D22;&#x5F15;3: [&apos;A&apos;, &apos;B&apos;, &apos;C&apos;]</span>
arr.slice(<span class="hljs-number">3</span>); <span class="hljs-comment">// &#x4ECE;&#x7D22;&#x5F15;3&#x5F00;&#x59CB;&#x5230;&#x7ED3;&#x675F;: [&apos;D&apos;, &apos;E&apos;, &apos;F&apos;, &apos;G&apos;]</span>
<span class="hljs-keyword">var</span> arr = [<span class="hljs-string">&apos;A&apos;</span>, <span class="hljs-string">&apos;B&apos;</span>, <span class="hljs-string">&apos;C&apos;</span>, <span class="hljs-string">&apos;D&apos;</span>, <span class="hljs-string">&apos;E&apos;</span>, <span class="hljs-string">&apos;F&apos;</span>, <span class="hljs-string">&apos;G&apos;</span>];
<span class="hljs-keyword">var</span> aCopy = arr.slice();
aCopy === arr; <span class="hljs-comment">// false</span>
</code></pre>
</li>
<li><p>push &#x548C;pop
<code>push()</code>&#x5411;<code>Array</code>&#x7684;&#x672B;&#x5C3E;&#x6DFB;&#x52A0;&#x82E5;&#x5E72;&#x5143;&#x7D20;&#xFF0C;<code>pop()</code>&#x5219;&#x628A;<code>Array</code>&#x7684;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#x5220;&#x9664;&#x6389;&#xFF1A;</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">var</span> arr = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>];
arr.push(<span class="hljs-string">&apos;A&apos;</span>, <span class="hljs-string">&apos;B&apos;</span>); <span class="hljs-comment">// &#x8FD4;&#x56DE;Array&#x65B0;&#x7684;&#x957F;&#x5EA6;: 4</span>
arr; <span class="hljs-comment">// [1, 2, &apos;A&apos;, &apos;B&apos;]</span>
arr.pop(); <span class="hljs-comment">// pop()&#x8FD4;&#x56DE;&apos;B&apos;</span>
arr; <span class="hljs-comment">// [1, 2, &apos;A&apos;]</span>
arr.pop(); arr.pop(); arr.pop(); <span class="hljs-comment">// &#x8FDE;&#x7EED;pop 3&#x6B21;</span>
arr; <span class="hljs-comment">// []</span>
arr.pop(); <span class="hljs-comment">// &#x7A7A;&#x6570;&#x7EC4;&#x7EE7;&#x7EED;pop&#x4E0D;&#x4F1A;&#x62A5;&#x9519;&#xFF0C;&#x800C;&#x662F;&#x8FD4;&#x56DE;undefined</span>
arr; <span class="hljs-comment">// []</span>
</code></pre>
</li>
<li><p>unshift &#x548C; shift</p>
<p>&#x5982;&#x679C;&#x8981;&#x5F80;<code>Array</code>&#x7684;&#x5934;&#x90E8;&#x6DFB;&#x52A0;&#x82E5;&#x5E72;&#x5143;&#x7D20;&#xFF0C;&#x4F7F;&#x7528;<code>unshift()</code>&#x65B9;&#x6CD5;&#xFF0C;<code>shift()</code>&#x65B9;&#x6CD5;&#x5219;&#x628A;<code>Array</code>&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#x5220;&#x6389;&#xFF1A;</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">var</span> arr = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>];
arr.unshift(<span class="hljs-string">&apos;A&apos;</span>, <span class="hljs-string">&apos;B&apos;</span>); <span class="hljs-comment">// &#x8FD4;&#x56DE;Array&#x65B0;&#x7684;&#x957F;&#x5EA6;: 4</span>
arr; <span class="hljs-comment">// [&apos;A&apos;, &apos;B&apos;, 1, 2]</span>
arr.shift(); <span class="hljs-comment">// &apos;A&apos;</span>
arr; <span class="hljs-comment">// [&apos;B&apos;, 1, 2]</span>
arr.shift(); arr.shift(); arr.shift(); <span class="hljs-comment">// &#x8FDE;&#x7EED;shift 3&#x6B21;</span>
arr; <span class="hljs-comment">// []</span>
arr.shift(); <span class="hljs-comment">// &#x7A7A;&#x6570;&#x7EC4;&#x7EE7;&#x7EED;shift&#x4E0D;&#x4F1A;&#x62A5;&#x9519;&#xFF0C;&#x800C;&#x662F;&#x8FD4;&#x56DE;undefined</span>
arr; <span class="hljs-comment">// []</span>
</code></pre>
</li>
<li><p>sort</p>
<p><code>sort()</code>&#x53EF;&#x4EE5;&#x5BF9;&#x5F53;&#x524D;<code>Array</code>&#x8FDB;&#x884C;&#x6392;&#x5E8F;&#xFF0C;&#x5B83;&#x4F1A;&#x76F4;&#x63A5;&#x4FEE;&#x6539;&#x5F53;&#x524D;<code>Array</code>&#x7684;&#x5143;&#x7D20;&#x4F4D;&#x7F6E;&#xFF0C;&#x76F4;&#x63A5;&#x8C03;&#x7528;&#x65F6;&#xFF0C;&#x6309;&#x7167;&#x9ED8;&#x8BA4;&#x987A;&#x5E8F;&#x6392;&#x5E8F;:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">var</span> arr = [<span class="hljs-string">&apos;B&apos;</span>, <span class="hljs-string">&apos;C&apos;</span>, <span class="hljs-string">&apos;A&apos;</span>];
arr.sort();
arr; <span class="hljs-comment">// [&apos;A&apos;, &apos;B&apos;, &apos;C&apos;]</span>
</code></pre>
</li>
<li><p>reverse</p>
<p><code>reverse()</code>&#x628A;&#x6574;&#x4E2A;<code>Array</code>&#x7684;&#x5143;&#x7D20;&#x7ED9;&#x6389;&#x4E2A;&#x4E2A;&#xFF0C;&#x4E5F;&#x5C31;&#x662F;&#x53CD;&#x8F6C;&#xFF1A;</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">var</span> arr = [<span class="hljs-string">&apos;one&apos;</span>, <span class="hljs-string">&apos;two&apos;</span>, <span class="hljs-string">&apos;three&apos;</span>];
arr.reverse(); 
arr; <span class="hljs-comment">// [&apos;three&apos;, &apos;two&apos;, &apos;one&apos;]</span>
</code></pre>
</li>
<li><p>splice</p>
<p><code>splice()</code>&#x65B9;&#x6CD5;&#x662F;&#x4FEE;&#x6539;<code>Array</code>&#x7684;&#x201C;&#x4E07;&#x80FD;&#x65B9;&#x6CD5;&#x201D;&#xFF0C;&#x5B83;&#x53EF;&#x4EE5;&#x4ECE;&#x6307;&#x5B9A;&#x7684;&#x7D22;&#x5F15;&#x5F00;&#x59CB;&#x5220;&#x9664;&#x82E5;&#x5E72;&#x5143;&#x7D20;&#xFF0C;&#x7136;&#x540E;&#x518D;&#x4ECE;&#x8BE5;&#x4F4D;&#x7F6E;&#x6DFB;&#x52A0;&#x82E5;&#x5E72;&#x5143;&#x7D20;&#xFF1A;</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">var</span> arr = [<span class="hljs-string">&apos;Microsoft&apos;</span>, <span class="hljs-string">&apos;Apple&apos;</span>, <span class="hljs-string">&apos;Yahoo&apos;</span>, <span class="hljs-string">&apos;AOL&apos;</span>, <span class="hljs-string">&apos;Excite&apos;</span>, <span class="hljs-string">&apos;Oracle&apos;</span>];
<span class="hljs-comment">// &#x4ECE;&#x7D22;&#x5F15;2&#x5F00;&#x59CB;&#x5220;&#x9664;3&#x4E2A;&#x5143;&#x7D20;,&#x7136;&#x540E;&#x518D;&#x6DFB;&#x52A0;&#x4E24;&#x4E2A;&#x5143;&#x7D20;:</span>
arr.splice(<span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-string">&apos;Google&apos;</span>, <span class="hljs-string">&apos;Facebook&apos;</span>); <span class="hljs-comment">// &#x8FD4;&#x56DE;&#x5220;&#x9664;&#x7684;&#x5143;&#x7D20; [&apos;Yahoo&apos;, &apos;AOL&apos;, &apos;Excite&apos;]</span>
arr; <span class="hljs-comment">// [&apos;Microsoft&apos;, &apos;Apple&apos;, &apos;Google&apos;, &apos;Facebook&apos;, &apos;Oracle&apos;]</span>
<span class="hljs-comment">// &#x53EA;&#x5220;&#x9664;,&#x4E0D;&#x6DFB;&#x52A0;:</span>
arr.splice(<span class="hljs-number">2</span>, <span class="hljs-number">2</span>); <span class="hljs-comment">// [&apos;Google&apos;, &apos;Facebook&apos;]</span>
arr; <span class="hljs-comment">// [&apos;Microsoft&apos;, &apos;Apple&apos;, &apos;Oracle&apos;]</span>
<span class="hljs-comment">// &#x53EA;&#x6DFB;&#x52A0;,&#x4E0D;&#x5220;&#x9664;:</span>
arr.splice(<span class="hljs-number">2</span>, <span class="hljs-number">0</span>, <span class="hljs-string">&apos;Google&apos;</span>, <span class="hljs-string">&apos;Facebook&apos;</span>); <span class="hljs-comment">// &#x8FD4;&#x56DE;[],&#x56E0;&#x4E3A;&#x6CA1;&#x6709;&#x5220;&#x9664;&#x4EFB;&#x4F55;&#x5143;&#x7D20;</span>
arr; <span class="hljs-comment">// [&apos;Microsoft&apos;, &apos;Apple&apos;, &apos;Google&apos;, &apos;Facebook&apos;, &apos;Oracle&apos;]</span>
</code></pre>
</li>
<li><p>join</p>
<p><code>join()</code>&#x65B9;&#x6CD5;&#x662F;&#x4E00;&#x4E2A;&#x975E;&#x5E38;&#x5B9E;&#x7528;&#x7684;&#x65B9;&#x6CD5;&#xFF0C;&#x5B83;&#x628A;&#x5F53;&#x524D;<code>Array</code>&#x7684;&#x6BCF;&#x4E2A;&#x5143;&#x7D20;&#x90FD;&#x7528;&#x6307;&#x5B9A;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x8FDE;&#x63A5;&#x8D77;&#x6765;&#xFF0C;&#x7136;&#x540E;&#x8FD4;&#x56DE;&#x8FDE;&#x63A5;&#x540E;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#xFF1A;</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">var</span> arr = [<span class="hljs-string">&apos;A&apos;</span>, <span class="hljs-string">&apos;B&apos;</span>, <span class="hljs-string">&apos;C&apos;</span>, <span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>];
arr.join(<span class="hljs-string">&apos;-&apos;</span>); <span class="hljs-comment">// &apos;A-B-C-1-2-3&apos;</span>
</code></pre>
<p>&#x5982;&#x679C;<code>Array</code>&#x7684;&#x5143;&#x7D20;&#x4E0D;&#x662F;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x5C06;&#x81EA;&#x52A8;&#x8F6C;&#x6362;&#x4E3A;&#x5B57;&#x7B26;&#x4E32;&#x540E;&#x518D;&#x8FDE;&#x63A5;&#x3002;</p>
</li>
<li><p>includes&#x65B9;&#x6CD5;</p>
<p><code>Array.prototype.includes</code>&#x65B9;&#x6CD5;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x5E03;&#x5C14;&#x503C;&#xFF0C;&#x8868;&#x793A;&#x67D0;&#x4E2A;&#x6570;&#x7EC4;&#x662F;&#x5426;&#x5305;&#x542B;&#x7ED9;&#x5B9A;&#x7684;&#x503C;&#xFF0C;&#x4E0E;&#x5B57;&#x7B26;&#x4E32;&#x7684;<code>includes</code>&#x65B9;&#x6CD5;&#x7C7B;&#x4F3C;&#x3002;ES2016 &#x5F15;&#x5165;&#x4E86;&#x8BE5;&#x65B9;&#x6CD5;&#x3002;</p>
<pre><code class="lang-javascript">[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>].includes(<span class="hljs-number">2</span>)     <span class="hljs-comment">// true</span>
[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>].includes(<span class="hljs-number">4</span>)     <span class="hljs-comment">// false</span>
[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-literal">NaN</span>].includes(<span class="hljs-literal">NaN</span>) <span class="hljs-comment">// true</span>
</code></pre>
</li>
<li><p>flat,flatMap</p>
<p>&#x6570;&#x7EC4;&#x7684;&#x6210;&#x5458;&#x6709;&#x65F6;&#x8FD8;&#x662F;&#x6570;&#x7EC4;&#xFF0C;<code>Array.prototype.flat()</code>&#x7528;&#x4E8E;&#x5C06;&#x5D4C;&#x5957;&#x7684;&#x6570;&#x7EC4;&#x201C;&#x62C9;&#x5E73;&#x201D;&#xFF0C;&#x53D8;&#x6210;&#x4E00;&#x7EF4;&#x7684;&#x6570;&#x7EC4;&#x3002;&#x8BE5;&#x65B9;&#x6CD5;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x65B0;&#x6570;&#x7EC4;&#xFF0C;&#x5BF9;&#x539F;&#x6570;&#x636E;&#x6CA1;&#x6709;&#x5F71;&#x54CD;&#x3002;</p>
<pre><code class="lang-javascript">[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, [<span class="hljs-number">3</span>, <span class="hljs-number">4</span>]].flat()
<span class="hljs-comment">// [1, 2, 3, 4]</span>
</code></pre>
</li>
</ul>
<p>&#x4E0A;&#x9762;&#x4EE3;&#x7801;&#x4E2D;&#xFF0C;&#x539F;&#x6570;&#x7EC4;&#x7684;&#x6210;&#x5458;&#x91CC;&#x9762;&#x6709;&#x4E00;&#x4E2A;&#x6570;&#x7EC4;&#xFF0C;<code>flat()</code>&#x65B9;&#x6CD5;&#x5C06;&#x5B50;&#x6570;&#x7EC4;&#x7684;&#x6210;&#x5458;&#x53D6;&#x51FA;&#x6765;&#xFF0C;&#x6DFB;&#x52A0;&#x5728;&#x539F;&#x6765;&#x7684;&#x4F4D;&#x7F6E;&#x3002;</p>
<p><code>flat()</code>&#x9ED8;&#x8BA4;&#x53EA;&#x4F1A;&#x201C;&#x62C9;&#x5E73;&#x201D;&#x4E00;&#x5C42;&#xFF0C;&#x5982;&#x679C;&#x60F3;&#x8981;&#x201C;&#x62C9;&#x5E73;&#x201D;&#x591A;&#x5C42;&#x7684;&#x5D4C;&#x5957;&#x6570;&#x7EC4;&#xFF0C;&#x53EF;&#x4EE5;&#x5C06;<code>flat()</code>&#x65B9;&#x6CD5;&#x7684;&#x53C2;&#x6570;&#x5199;&#x6210;&#x4E00;&#x4E2A;&#x6574;&#x6570;&#xFF0C;&#x8868;&#x793A;&#x60F3;&#x8981;&#x62C9;&#x5E73;&#x7684;&#x5C42;&#x6570;&#xFF0C;&#x9ED8;&#x8BA4;&#x4E3A;1&#x3002;</p>
<pre><code class="lang-javascript">[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, [<span class="hljs-number">3</span>, [<span class="hljs-number">4</span>, <span class="hljs-number">5</span>]]].flat()
<span class="hljs-comment">// [1, 2, 3, [4, 5]]</span>

[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, [<span class="hljs-number">3</span>, [<span class="hljs-number">4</span>, <span class="hljs-number">5</span>]]].flat(<span class="hljs-number">2</span>)
<span class="hljs-comment">// [1, 2, 3, 4, 5]</span>
</code></pre>
<p>&#x4E0A;&#x9762;&#x4EE3;&#x7801;&#x4E2D;&#xFF0C;<code>flat()</code>&#x7684;&#x53C2;&#x6570;&#x4E3A;2&#xFF0C;&#x8868;&#x793A;&#x8981;&#x201C;&#x62C9;&#x5E73;&#x201D;&#x4E24;&#x5C42;&#x7684;&#x5D4C;&#x5957;&#x6570;&#x7EC4;&#x3002;</p>
<p>&#x5982;&#x679C;&#x4E0D;&#x7BA1;&#x6709;&#x591A;&#x5C11;&#x5C42;&#x5D4C;&#x5957;&#xFF0C;&#x90FD;&#x8981;&#x8F6C;&#x6210;&#x4E00;&#x7EF4;&#x6570;&#x7EC4;&#xFF0C;&#x53EF;&#x4EE5;&#x7528;<code>Infinity</code>&#x5173;&#x952E;&#x5B57;&#x4F5C;&#x4E3A;&#x53C2;&#x6570;&#x3002;</p>
<pre><code class="lang-javascript">[<span class="hljs-number">1</span>, [<span class="hljs-number">2</span>, [<span class="hljs-number">3</span>]]].flat(<span class="hljs-literal">Infinity</span>)
<span class="hljs-comment">// [1, 2, 3]</span>
</code></pre>
<p>&#x5982;&#x679C;&#x539F;&#x6570;&#x7EC4;&#x6709;&#x7A7A;&#x4F4D;&#xFF0C;<code>flat()</code>&#x65B9;&#x6CD5;&#x4F1A;&#x8DF3;&#x8FC7;&#x7A7A;&#x4F4D;&#x3002;</p>
<pre><code class="lang-javascript">[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, , <span class="hljs-number">4</span>, <span class="hljs-number">5</span>].flat()
<span class="hljs-comment">// [1, 2, 4, 5]</span>
</code></pre>
<p><code>flatMap()</code>&#x65B9;&#x6CD5;&#x5BF9;&#x539F;&#x6570;&#x7EC4;&#x7684;&#x6BCF;&#x4E2A;&#x6210;&#x5458;&#x6267;&#x884C;&#x4E00;&#x4E2A;&#x51FD;&#x6570;&#xFF08;&#x76F8;&#x5F53;&#x4E8E;&#x6267;&#x884C;<code>Array.prototype.map()</code>&#xFF09;&#xFF0C;&#x7136;&#x540E;&#x5BF9;&#x8FD4;&#x56DE;&#x503C;&#x7EC4;&#x6210;&#x7684;&#x6570;&#x7EC4;&#x6267;&#x884C;<code>flat()</code>&#x65B9;&#x6CD5;&#x3002;&#x8BE5;&#x65B9;&#x6CD5;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x65B0;&#x6570;&#x7EC4;&#xFF0C;&#x4E0D;&#x6539;&#x53D8;&#x539F;&#x6570;&#x7EC4;&#x3002;</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// &#x76F8;&#x5F53;&#x4E8E; [[2, 4], [3, 6], [4, 8]].flat()</span>
[<span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>].flatMap((x) =&gt; [x, x * <span class="hljs-number">2</span>])
<span class="hljs-comment">// [2, 4, 3, 6, 4, 8]</span>
</code></pre>
<p><code>flatMap()</code>&#x53EA;&#x80FD;&#x5C55;&#x5F00;&#x4E00;&#x5C42;&#x6570;&#x7EC4;&#x3002;</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// &#x76F8;&#x5F53;&#x4E8E; [[[2]], [[4]], [[6]], [[8]]].flat()</span>
[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>].flatMap(x =&gt; [[x * <span class="hljs-number">2</span>]])
<span class="hljs-comment">// [[2], [4], [6], [8]]</span>
</code></pre>
<h3 id="&#x6570;&#x7EC4;&#x7684;&#x6269;&#x5C55;-es6">&#x6570;&#x7EC4;&#x7684;&#x6269;&#x5C55; es6</h3>
<p>&#x6269;&#x5C55;&#x8FD0;&#x7B97;&#x7B26;&#xFF08;spread&#xFF09;&#x662F;&#x4E09;&#x4E2A;&#x70B9;&#xFF08;<code>...</code>&#xFF09;&#x3002;&#x5B83;&#x597D;&#x6BD4; rest &#x53C2;&#x6570;&#x7684;&#x9006;&#x8FD0;&#x7B97;&#xFF0C;&#x5C06;&#x4E00;&#x4E2A;&#x6570;&#x7EC4;&#x8F6C;&#x4E3A;&#x7528;&#x9017;&#x53F7;&#x5206;&#x9694;&#x7684;&#x53C2;&#x6570;&#x5E8F;&#x5217;&#x3002;</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">console</span>.log(...[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>])
<span class="hljs-comment">// 1 2 3</span>

<span class="hljs-built_in">console</span>.log(<span class="hljs-number">1</span>, ...[<span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>], <span class="hljs-number">5</span>)
<span class="hljs-comment">// 1 2 3 4 5</span>
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="对象.html" class="navigation navigation-prev " aria-label="Previous page: 对象">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="Symbol.html" class="navigation navigation-next " aria-label="Next page: Symbol">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"数组","level":"1.2.6","depth":2,"next":{"title":"Symbol","level":"1.2.7","depth":2,"path":"基础/Symbol.md","ref":"基础/Symbol.md","articles":[]},"previous":{"title":"对象","level":"1.2.5","depth":2,"path":"基础/对象.md","ref":"./基础/对象.md","articles":[]},"dir":"ltr"},"config":{"plugins":["lunr","pageview-count","chapter-fold","back-to-top-button","code","hide-element","-sharing","sharing-plus","custom-favicon"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"chapter-fold":{},"search":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"lunr":{"ignoreSpecialCharacters":false,"maxIndexSize":1000000},"code":{"copyButtons":true},"hide-element":{"elements":[".gitbook-link"]},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"js.ico","back-to-top-button":{},"pageview-count":{},"custom-favicon":{},"sharing":{"qq":true,"all":["douban","facebook","google","instapaper","linkedin","twitter","weibo","messenger","qq","qzone","viber","whatsapp"],"douban":true,"facebook":true,"weibo":true,"twitter":true,"pocket":true,"google":true,"qzone":true},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"Veng","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"JavaScript学习","language":"zh-hans","gitbook":"*","description":"javaScript的学习笔记"},"file":{"path":"基础/数组.md","mtime":"2020-12-10T02:10:04.990Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-12-10T03:00:51.663Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-hide-element/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

